#include "block.h"
#include "grid.h"
#include "cgnsReader.h"
#include "vizGrid.h"
#include "scalarField.h"
#include "vectorField.h"
#include "stencil.h"

using namespace pavan;
using namespace util;

static double cd2_coeff[] = { -0.5 , 0 , 0.5 };

int main( void ) {

  grid<int,double,2> gg;
  readPlot3DGrid( gg , "example/simple.p3d" , "example/simple.info" );
  vizGrid( gg , "bloody.dat" );

  scalarPointField<int,double,2> phi( gg , "phi" );
  vectorPointField<int,double,2,2> phiv( gg , "phiv" );
  
  interiorStencil<int,double,2,1,1> cd2;
  cd2.setCoeff( cd2_coeff );
  tmp< scalarPointField<int,double,2> > tpf = cd2.applyStencil<0>( phi );
  for( int iblk = 0 ; iblk < tpf().data().size() ; ++iblk )
    std::cout << tpf().data()[iblk] << "\n";
  return 0;
}

